package com.yuhang.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuhang.entity.HyActivity;
import com.yuhang.entity.HyAdmin;
import com.yuhang.mapper.HyActivityMapper;
import com.yuhang.service.HyActivityService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yuhang
 * @since 2021-04-25
 */
@Service
public class HyActivityServiceImpl extends ServiceImpl<HyActivityMapper, HyActivity> implements HyActivityService {

    @Autowired
    private HyActivityMapper hyActivityMapper;

    @Override
    public IPage<HyActivity> selectByPage(int pageNum, int pageSize,String liketitle) {
        Page<HyActivity> page = new Page(pageNum,pageSize);
        QueryWrapper<HyActivity> qw = new QueryWrapper();
        if(liketitle!=null&&!liketitle.equals("")){
            qw.like("title",liketitle);
        }
        IPage<HyActivity> iPage = hyActivityMapper.selectPage(page,qw);
        return iPage;
    }
}
